<?php
//error_reporting(0); 
$url = $_GET['url'];
$url = urldecode($url);

if (substr($url,0,16)=="https://v.qq.com"){
    $back = vget($url);
    $_back = explode("id: '", $back);
    $_back = explode("';", $_back[1]);
    if (empty($_back[0])){
        $_back = explode('&vid=', $back);
        $_back = explode('&ptag=', $_back[1]);
    }
    $vid = $_back[0];
}
if (substr($url,0,18)=="https://m.v.qq.com" || substr($url,0,17)=="http://m.v.qq.com"){
    $back = vget($url);
    $back = explode("else if ('", $back);
    $back = explode("') {", $back[1]);
    $vid = $back[0];
}
if (!empty($vid)){
    echo '<iframe src="https://v.qq.com/iframe/player.html?vid='.$vid.'&amp;tiny=0&amp;auto=0" frameborder="0" height="250" width="100%"></iframe>';
}
function vget($url,$header = array()){
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 1);
    curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
    curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt($curl, CURLOPT_AUTOREFERER, 1);
    curl_setopt($curl, CURLOPT_TIMEOUT, 30);
    curl_setopt($curl, CURLOPT_HEADER, 0);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    $tmpInfo = curl_exec($curl);
    if (curl_errno($curl)) {
       return 'Error';
    }
    curl_close($curl);
    return $tmpInfo;
}
?>